import { FieldType } from 'choerodon-ui/pro/lib/data-set/enum';
import { DataSetProps } from 'choerodon-ui/pro/lib/data-set/DataSet';

const getFormDS = (): DataSetProps => ({
  name: 'form-step-form',
  autoCreate: true,
  autoQuery: false,
  fields: [
    // 第一步
    {name: 'payAccount', type: FieldType.string, label: '付款账户', required: true},
    {name: 'receiverAccount', type: FieldType.email, label: '收款账户', required: true},
    {name: 'receiverName', type: FieldType.string, label: '收款人姓名', required: true},
    {name: 'amount', type: FieldType.number, label: '转账金额', required: true},
    {name: 'paymentType', type: FieldType.string, label: '支付方式', defaultValue: 'alipay'},
    // 第二步
    {name: 'password', type: FieldType.string, label: '支付密码', required: true},
  ],
  transport: {
    submit: {
      url: '/_api/form-step-form',
      method: 'post',
    },
  },
});

export default getFormDS;